package com.jmhy.sdk.view;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.TextView;
import com.jmhy.sdk.config.AppConfig;

public class HideFloatDialog extends Dialog implements OnClickListener {
    private TextView mCancelbt;
    private Context mContext;
    private TextView mDelete;
    private HideDialogListener mExitdialoglistener;
    private View mView;

    public interface HideDialogListener {
        void onCancel();

        void onConfirm();
    }

    public HideFloatDialog(Context context, int theme, HideDialogListener exitListener) {
        super(context, theme);
        this.mContext = context;
        this.mExitdialoglistener = exitListener;
        switch (AppConfig.skin) {
            case 9:
                this.mView = LayoutInflater.from(context).inflate(AppConfig.resourceId(context, "jm_hide_dialog", "layout"), null);
                return;
            default:
                this.mView = LayoutInflater.from(context).inflate(AppConfig.resourceId(context, "jm_hide_dialog", "layout"), null);
                return;
        }
    }

    /* Access modifiers changed, original: protected */
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(this.mView);
        this.mDelete = (TextView) findViewById(AppConfig.resourceId(this.mContext, "dialog_delete", "id"));
        this.mCancelbt = (TextView) findViewById(AppConfig.resourceId(this.mContext, "dialog_cancel", "id"));
        this.mDelete.setOnClickListener(this);
        this.mCancelbt.setOnClickListener(this);
    }

    public void onClick(View v) {
        if (v.getId() == this.mDelete.getId()) {
            this.mExitdialoglistener.onConfirm();
        } else if (v.getId() == this.mCancelbt.getId()) {
            this.mExitdialoglistener.onCancel();
        }
        dismiss();
    }
}